# Filters added to this controller will be run for all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
  before_filter :authorize
  
  def authorize
    unless session[:user_id].nil?
      @current_user = User.find session[:user_id].to_i
    else
      redirect_to :controller => "login", 
      :action => "index"
    end

  end

end